home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu276.dms / pu276.adf / BBBBS / BBBBSDoors53.LZH / rexxDoors / Chicago.rexx < prev    next >
OS/2 REXX Batch file  |  1992-07-27  |  49KB  |  1,773 lines

  1. /* Chicago Gangland Version 1.21 by Steve Robbins*/
  2. /* Converted by David Prothero */
  3. /* Converted by David Simpson for BBBBS */
  4. /* Version 1.3 by Matt English 6-21-92.
  5.    New Features: Bugs fixxed, plays better in local mode, and
  6.    UnderWorld Casino at location 25, 25!
  7.  
  8.    New Features in version 1.4: by Matt English 7-10-92
  9.    Full menu option added, Leave a comment to next gangster,
  10.    Game resets and adds winners name to "GangLord Hall of Fame"
  11.    when player reaches 500,000 points.
  12.  
  13.    Version 1.41 7-25-92 by Matt Egnlish
  14.    There was a small bug! Yikes!
  15.    
  16.    Version 1.42 7-26-92 by RLStockton
  17.    To work better without BaudBandit in LOCAL mode */
  18.  
  19.  
  20. options results
  21.  
  22. CR='0D'x  /* Carraige Return */
  23. SIGNAL ON BREAK_C
  24. SIGNAL ON BREAK_E
  25.  
  26. bbspath=GETCLIP('BBS_path')
  27. bbspath1 = bbspath'rexxdoors/'
  28. bbspath2=bbspath'rexxDoors/Data/'
  29.  
  30. PARSE arg Username winnings savewinnings colorflag .
  31.  
  32.  
  33. signal on syntax
  34. signal on ioerr
  35.  
  36. /* Open the support library if it is not already open. */
  37. if ~show('L',"rexxsupport.library") then do
  38.     addlib('rexxsupport.library',0,-30,0)
  39.      end
  40.  
  41. info= 's:CONFIG.BBS'
  42. call open(con,info,'R')
  43. lynes.1=readln(con)
  44.  
  45. compos=POS('/*',lynes.1)
  46. IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
  47.  bbsname=STRIP(lynes.1)
  48. call close(con)
  49.  
  50. Name = Username
  51. Spacename = Name
  52. /*ansiflag = result*/
  53. LINES = 20  /* upper(result) - 2 */
  54. ADDRESS rexx 'random(1,2,time('S'))'
  55. if colorflag = 1 then
  56.   do
  57.     WHITE = ''
  58.     RED = ''
  59.     YELLOW =''
  60.     BLACK = ''
  61.     GREEN = ''
  62.     CYAN = ''
  63.     MAGENTA = ''
  64.     BLUE = ''
  65.     IF ADDRESS()~='BAUD' THEN BLUE=GREEN
  66.     CLEAR = ''
  67.     HOM = 'H'
  68.     CLSCREEN = ''
  69.   end 
  70. else
  71.   do
  72.     WHITE = ''
  73.     RED = ''
  74.     YELLOW =''
  75.     BLACK = ''
  76.     GREEN = ''
  77.     CYAN = ''
  78.     MAGENTA = ''
  79.     BLUE = ''
  80.     CLEAR = ''
  81.     HOM = ''
  82.     CLSCREEN = ''
  83. end
  84. File.1 =  bbspath2'gangland/instructions'
  85. File.2 =  bbspath2'gangland/news7'
  86. File.3 =  bbspath2'gangland/news6'
  87. File.4 =  bbspath2'gangland/news5'
  88. File.5 =  bbspath2'gangland/news4'
  89. File.6 =  bbspath2'gangland/news3'
  90. File.7 =  bbspath2'gangland/news2'
  91. File.8 =  bbspath2'gangland/news1'
  92. File.9 =  bbspath2'gangland/protect'
  93. File.10 = bbspath2'gangland/position'
  94. File.11 = bbspath2'gangland/chic.oneliner'
  95. File.12 = bbspath2'gangland/chic.fame'
  96. File.13 = bbspath2'gangland/aliases'
  97. File.14 = bbspath2'gangland/top10'
  98. /* Starting Stats */
  99. turnsleft = 25
  100. gangmembers = 50
  101. datec = date()
  102. points = 5000
  103. protection = 0
  104. totalgangmembers = 50
  105. money = 1000
  106. bootleg = 0
  107. costfor = 1
  108. pos = 0
  109. deathflag = 0
  110. menus = 0
  111.   longdashes='-----------------------------------------------------------------------------'
  112. /*begin*/
  113. if exists(bbspath2'gangland/position') then
  114.   do
  115.     call open(lastpos,bbspath2'gangland/position','R')
  116.     do i = 1 to 10000
  117.       mypos.i = readln(lastpos)
  118.       posstartx.i = Word(mypos.i,1)
  119.       posstarty.i = Word(mypos.i,2)
  120.       posgang.i = Word(mypos.i,3)
  121.       posmoney.i = Word(mypos.i,4)
  122.       posalias.i = Delword(mypos.i,1,4)
  123.       if EOF(lastpos) then break
  124.       pos = pos + 1
  125.     end
  126.     call close(lastpos)
  127.   end
  128. call open(prot,file.9,'R')
  129. say'Loading Chicago Gangland...'cr
  130. do c = 1 to 25
  131.    CALL WRITECH(STDOUT,'.')
  132.    do c1 = 1 to 25
  133.       protect.c.c1 = readln(prot)
  134.    end
  135. end
  136. datel = readln(prot)
  137. if datec ~= datel then
  138.   do
  139.     SAY ''||CR
  140.     SAY ''||CR
  141.     SAY CYAN'Standby, running maintenance program.'CLEAR||CR
  142.     call seek(prot,0,'B')
  143.     do i = 1 to 625
  144.         proln.i = readln(prot)
  145.     end
  146.     call close(prot)
  147.     call open(prot,File.9,'W')
  148.     do i = 1 to 625
  149.         call writeln(prot,proln.i)
  150.     end
  151.     call writeln(prot,datec)
  152.     if exists(file.8) then address command 'c:delete 'file.8' quiet'
  153.     if exists(file.7) then address command 'c:rename 'file.7' 'file.8' quiet'
  154.     if exists(file.6) then address command 'c:rename 'file.6' 'file.7' quiet'
  155.     if exists(file.5) then address command 'c:rename 'file.5' 'file.6' quiet'
  156.     if exists(file.4) then address command 'c:rename 'file.4' 'file.5' quiet'
  157.     if exists(file.3) then address command 'c:rename 'file.3' 'file.4' quiet'
  158.     if exists(file.2) then address command 'c:rename 'file.2' 'file.3' quiet'
  159.     call open(news7,file.2,'W')
  160.     call writeln(news7,'******************************************************')
  161.     call writeln(news7,'                THE CHICAGO DAILY NEWS')
  162.     call writeln(news7,'                     'datec)
  163.     call writeln(news7,'******************************************************')
  164.     call writeln(news7,' ')
  165.     call close(news7)
  166.  
  167.     call open(aliases,bbspath2'gangland/aliases','R')
  168.     i = 0
  169.     do until EOF(aliases)
  170.         i = i + 1
  171.         line.i = readln(aliases)
  172.     end
  173.     call close(aliases)
  174.     do u = 1 to 10000
  175.         if u = i then signal cont
  176.         Namem = word(line.u,1)
  177.         if namem = '' then namem = junk
  178.         alias = Delword(line.u,1,1)
  179.         if exists(bbspath2'gangland/'Namem) then
  180.           do
  181.             call open(stats,bbspath2'gangland/'Namem,'R')
  182.             aliasa = readln(stats)
  183.             Turnsleftm = readln(stats)
  184.             gangmembersm = readln(stats)
  185.             datem = readln(stats)
  186.             startxm = readln(stats)
  187.             startym = readln(stats)
  188.             pointsm = readln(stats)
  189.             moneym = readln(stats)
  190.             totalgangmembersm = readln(stats)
  191.             protectionm = readln(stats)
  192.             bootlegm = readln(stats)
  193.             call close(stats)
  194.             protectmoney = protectionm * 200
  195.             bootlegmoney = bootlegm * 500
  196.             moneym = moneym + protectmoney + bootlegmoney
  197.             turnsleftm = 25
  198.             call open(stats,bbspath2'gangland/'Namem,'W')
  199.             call writeln(stats,aliasa)
  200.             call writeln(stats,turnsleftm)
  201.             call writeln(stats,gangmembersm)
  202.             call writeln(stats,datem)
  203.             call writeln(stats,startxm)
  204.             call writeln(stats,startym)
  205.             call writeln(stats,pointsm)
  206.             call writeln(stats,moneym)
  207.             call writeln(stats,totalgangmembersm)
  208.             call writeln(stats,protectionm)
  209.             call writeln(stats,bootlegm)
  210.             call close(stats)
  211.           end
  212.     end
  213.   end
  214. cont:
  215. SAY ''||CR
  216. SAY ''||CR
  217. SAY BLUE'Done'||CR
  218. call close(prot)
  219.                                              
  220. street.1 = First
  221. street.2 = Second
  222. street.3 = Third
  223. street.4 = Fourth
  224. street.5 = Fifth
  225. street.6 = Sixth
  226. street.7 = Seventh
  227. street.8 = Eighth
  228. street.9 = Ninth
  229. street.10 = Tenth
  230. street.11 = Eleventh
  231. street.12 = Twelveth
  232. street.13 = Thirteenth
  233. street.14 = Fourteenth
  234. street.15 = Fifteenth
  235. street.16 = Sixteenth
  236. street.17 = Seventeenth
  237. street.18 = Eighteenth
  238. street.19 = Nineteenth
  239. street.20 = Twentieth
  240. street.21 = Twentyfirst
  241. street.22 = Twentysecond
  242. street.23 = Twentythird
  243. street.24 = Twentyfourth
  244. street.25 = Twentyfifth
  245.  
  246. say CLSCREEN
  247. SAY ''||CR
  248. SAY ''||CR
  249. SAY BLUE'                 +----------------------------------------------+'CLEAR||CR
  250. SAY BLUE'                 |               'YELLOW'CHICAGO GANGLAND'BLUE'               |'CLEAR||CR
  251. SAY BLUE'                 |            'YELLOW'Written for SkyLine BBS'BLUE'           |'CLEAR||CR
  252. SAY BLUE'                 |               'YELLOW'by Steve Robbins'BLUE'               |'CLEAR||CR
  253. SAY BLUE'                 |                'YELLOW'Copyright 1990'BLUE'                |'CLEAR||CR
  254. SAY BLUE'                 |                                              |'CLEAR||CR
  255. SAY BLUE'                 |            'RED'Converted to TransAmiga'BLUE'           |'CLEAR||CR
  256. SAY BLUE'                 |               'RED'by David Prothero'BLUE'              |'CLEAR||CR
  257. SAY BLUE'                 |                                              |'CLEAR||CR
  258. SAY BLUE'                 |              'RED'Converted to BBBBS'BLUE'              |'CLEAR||CR
  259. SAY BLUE'                 |               'RED'by David Simpson'BLUE'               |'CLEAR||CR
  260. SAY BLUE'                 |                                              |'CLEAR||CR
  261. SAY BLUE'                 |       'MAGENTA'Version 1.42 includes UnderWorld'BLUE'       |'CLEAR||CR
  262. SAY BLUE'                 |       'MAGENTA'Casino feature, located at 25, 25.'BLUE'     |'CLEAR||CR
  263. SAY BLUE'                 |             'MAGENTA'by Matt English 7-26-92'BLUE'          |'CLEAR||CR
  264. SAY BLUE'                 |                                              |'
  265. SAY BLUE'                 +----------------------------------------------+'CLEAR||CR
  266. SAY CR
  267. say ''cr
  268. call pressreturn
  269. /*continue*/
  270.  
  271. aliascheck: 
  272. call open(aliases,bbspath2'gangland/aliases','R')
  273. u = 1
  274. do until EOF(aliases)
  275.    alias1.u = readln(aliases)
  276.    alias2.u = word(alias1.u,1)
  277.    alias3.u = Delword(alias1.u,1,1)
  278.    u = u + 1
  279. end
  280. call close(aliases)
  281. marker = u - 1
  282. if ~exists(bbspath2'gangland/'Name) then
  283.   do
  284.     options prompt Magenta'Please enter an alias: '
  285.     pull alias
  286.     options prompt ' '
  287.     if alias = '' then
  288.       do
  289.         SAY RED'You must enter an alias!'CLEAR||CR
  290.         signal aliascheck
  291.       end
  292.     u = 1
  293.     do i = 1 to marker
  294.         if alias = alias3.u then
  295.           do
  296.             SAY RED'That alias is already being used!'||CR
  297.             CALL delay(100)
  298.             signal aliascheck
  299.           end                  
  300.     u = u + 1
  301.     end
  302.     call open(aliases,bbspath2'gangland/aliases','W')
  303.     do i = 1 to (u + 1)
  304.         call writeln(aliases,alias1.i)
  305.     end
  306.     call writeln(aliases,Name' 'alias)
  307.     call close(aliases)
  308.   end
  309. signal begin 
  310.  
  311. begin:
  312. if ~exists(bbspath2'gangland/'Name) then do
  313.    call open(stats,bbspath2'gangland/'Name,'W')
  314.    call writeln(stats,alias)
  315.    call writeln(stats,turnsleft)
  316.    call writeln(stats,gangmembers)
  317.    call writeln(stats,datec)
  318.    startx = upper(random(1,25,time('s')))
  319.    call writeln(stats,startx)
  320.    starty = upper(random(1,25,time('s')))
  321.    call writeln(stats,starty)
  322.    call writeln(stats,points)
  323.    call writeln(stats,money)
  324.    call writeln(stats,totalgangmembers)
  325.    call writeln(stats,protection)
  326.    call writeln(stats,bootleg)
  327.    call close(stats)
  328.    call open(news7,file.2,'A')
  329.    call writeln(news7,'Ganglord 'alias' has moved into the Chicago!')
  330.    call close(news7)
  331.    signal menuopt
  332. end
  333. else do    
  334.    call open(stats,bbspath2'gangland/'Name,'R')
  335.    alias = readln(stats)
  336.    Turnsleft = readln(stats)
  337.    gangmembers = readln(stats)
  338.    date = readln(stats)
  339.    startx = readln(stats)
  340.    starty = readln(stats)
  341.    points = readln(stats)
  342.    money = readln(stats)
  343.    totalgangmembers = readln(stats)
  344.    protection = readln(stats)
  345.    bootleg = readln(stats)
  346.    call close(stats)
  347.    if datec = date & turnsleft = 0 then do
  348.       say CLSCREEN
  349.       SAY ''||CR
  350.       SAY RED'You are out of turns for today!'CLEAR||CR
  351.       CALL delay(100)
  352.       signal quickexit
  353.    end   
  354.    if datec ~= date then turnsleft = 25
  355.    call open(news7,file.2,'A')
  356.    call writeln(news7,'Ganglord 'alias' is active again!')
  357.    call close(news7)
  358.    signal menuopt
  359. end
  360.  
  361. menuopt:
  362.  say ''cr
  363. options prompt'   Would you like to have full menus for this game? (N,y) > '
  364. pull menuans
  365. if menuans = 'Y' then menus = 1
  366. if menuans = 'N' then do
  367.  say ''cr
  368.  say' OK, no menus. If you change your mind, type ''T'' at the prompt.'cr
  369.  end
  370. say ''cr
  371. signal Fame
  372.  
  373. Fame:
  374.  if exists(file.12) then do
  375.   call open(fm,file.12,'R')
  376.   fameline = '********************************************'
  377.   fameline = center(fameline,70)
  378.   say MAGENTA''fameline''cr
  379.   headerline = 'GangLord Hall of Fame'
  380.   headerline = center(headerline,70)
  381.   say YELLOW''headerline''cr
  382.   say MAGENTA''fameline''CLEAR''cr
  383.   say ''cr
  384.    do until eof(fm)
  385.     fmline = readln(fm)
  386.     fmline = center(fmline,70)
  387.     say GREEN''fmline''clear''cr
  388.     end
  389.   say ''cr
  390.   say ''cr
  391.   call close(fm)
  392.   end
  393.   CALL delay(100)
  394.  signal readoneliner
  395.  
  396. readoneliner:
  397. if ~exists(file.11) then signal MAIN
  398. say ''cr
  399. call open(fny,file.11,'R');mess=readln(fny);bywhom=readln(fny)
  400. say ''longdashes''cr;say ''CYAN''mess ''YELLOW''bywhom''CLEAR''cr;say ''longdashes''cr
  401. call close(fny);call delay(200)
  402. signal MAIN
  403.  
  404. main:
  405. if startx = 1 & starty = 1 then signal pool
  406. if startx = 25 & starty = 25 then signal casino
  407. say CLSCREEN
  408. if menus = 1 then do
  409.   SAY ''||CR
  410.    SAY '          'YELLOW'Q = Quit to' bbsname ''||CR
  411.    SAY '          S = Shootout'||CR
  412.    SAY '          O = Offer protection to the storeowners'||CR
  413.    SAY '          A = Add more protection to this block'||CR
  414.    SAY '          H = Hit the the protected block of another gang'||CR
  415.    SAY '          M = Move to another block'||CR
  416.    SAY '          G = Ganglord scores'||CR
  417.    SAY '          N = Chicago Daily News'||CR
  418.    SAY '          I = Instructions'||CR
  419.    SAY '          Y = Your statistics'||CR
  420.    SAY '          T = Toggle menus on/off'CLEAR||CR
  421.    SAY ''||CR
  422.   end
  423. SAY center(''GREEN''alias'',70)||CR
  424. SAY ''||CR
  425. SAY CYAN'You are at the corner of 'street.startx' North and 'street.starty' East'||CR
  426. SAY 'You have 'gangmembers' gangmembers with you'||CR
  427. protect_alias = Delword(protect.startx.starty,1,1)
  428. protect_gang = Word(protect.startx.starty,1)
  429. if protect_alias ~= '' then do
  430.    proflag = 0
  431.    SAY 'This block is protected by' GREEN||protect_alias||CLEAR||CR
  432. end
  433. else do
  434.    SAY 'This block is not under protection'||CLEAR||CR
  435.    proflag = 1
  436. end
  437. if 1 <= pos then do i = 1 to pos
  438.    if posstartx.i = startx & posstarty.i = starty & alias ~= posalias.i then
  439.    SAY 'You also see 'posalias.i' on this block there are 'posgang.i' gangmembers with him!'||CR
  440. end
  441. SAY ''||CR
  442. Options prompt MAGENTA'Q S O A H M G N I Y T ? ('YELLOW||turnsleft||MAGENTA')>'CLEAR
  443. pull ans
  444. if ans = '###PANIC' then signal goodbye
  445. if ans = 'Q' then signal goodbye
  446. if ans = 'S' then signal shootout
  447. if ans = 'O' then signal protection
  448. if ans = 'A' then signal addon
  449. if ans = 'H' then signal hitother
  450. if ans = 'M' then signal move
  451. if ans = 'G' then signal highscores
  452. if ans = 'N' then signal news
  453. if ans = 'I' then signal instructions
  454. if ans = 'Y' then signal stats
  455. if ans = 'T' then do
  456.  say ''cr
  457.  if menus = 0 then do
  458.   say'  OK, I''ll turn your menus on!'cr
  459.   menus = 1
  460.   say ''cr
  461.   signal main
  462.   end
  463.  if menus = 1 then do
  464.   say'  OK, your menus are now turned off.'cr
  465.   menus = 0
  466.   say ''cr
  467.   signal main
  468.   end
  469. end
  470. if ans = '' then signal main
  471. if ans = '?' then do
  472.    SAY ''||CR
  473.    SAY '          'YELLOW'Q = Quit to' bbsname ''||CR
  474.    SAY '          S = Shootout'||CR
  475.    SAY '          O = Offer protection to the storeowners'||CR
  476.    SAY '          A = Add more protection to this block'||CR
  477.    SAY '          H = Hit the the protected block of another gang'||CR
  478.    SAY '          M = Move to another block'||CR
  479.    SAY '          G = Ganglord scores'||CR
  480.    SAY '          N = Chicago Daily News'||CR
  481.    SAY '          I = Instructions'||CR
  482.    SAY '          Y = Your statistics'||CR
  483.    SAY '          T = Toggle menus'CLEAR||CR
  484.    SAY ''||CR
  485.    call pressreturn
  486.    /*continue*/
  487. end
  488. signal main
  489.      
  490. pool:
  491. say CLSCREEN
  492. if menus = 1 then do
  493.    SAY ''||CR
  494.    SAY '          'YELLOW'M = Move'||CR
  495.    SAY '          H = Hire new gangmembers'||CR
  496.    SAY '          B = Buy a bootleg operation'||CR
  497.    SAY '          G = Gamble at a game of pool'||CR
  498.    SAY '          Q = Quit to 'bbsname ''CLEAR||CR
  499.    SAY ''||CR
  500.   end
  501. say yellow'Check out the UnderWorld Casino! At 25, 25.'clear||cr
  502. say ''cr
  503. SAY GREEN'Welcome to the Southside Pool Hall'||CR
  504. SAY 'What is your pleasure?'CLEAR||CR
  505. SAY ''||CR
  506. Options Prompt YELLOW'M H B G Q ? ('turnsleft')>'CLEAR
  507. pull ANS
  508. if ans = '###PANIC' then signal goodbye
  509. if ans = 'M' then signal move
  510. if ans = 'H' then signal hire
  511. if ans = 'B' then signal still
  512. if ans = 'G' then signal gamble
  513. if ans = 'Q' then do
  514.    startx = upper(random(1,25,time('s')))
  515.    starty = upper(random(1,25,time('s')))
  516.    signal goodbye
  517. end
  518. if ans = '' then signal pool
  519. if ans = '?' then do
  520.    SAY ''||CR
  521.    SAY '          'YELLOW'M = Move'||CR
  522.    SAY '          H = Hire new gangmembers'||CR
  523.    SAY '          B = Buy a bootleg operation'||CR
  524.    SAY '          G = Gamble at a game of pool'||CR
  525.    SAY '          Q = Quit to 'bbsname ''CLEAR||CR
  526.    SAY ''||CR
  527.    call pressreturn
  528.    /*continue*/
  529. end
  530. signal main
  531.  
  532. casino:
  533. say CLSCREEN
  534. if menus = 1 then do
  535.    SAY ''||CR
  536.    SAY '          'YELLOW'M = Move'||CR
  537.    SAY '          H = Hire new gangmembers'||CR
  538.    SAY '          B = Play a hand of BlackJack'||CR
  539.    SAY '          S = Try the Slot machine'||CR
  540.    SAY '          Q = Quit to 'bbsname ''CLEAR||CR
  541.    SAY ''||CR
  542.    end
  543. SAY GREEN'   Welcome to the Underworld Casino'||CR
  544. SAY '   What is your pleasure?'CLEAR||CR
  545. say'   You have $'money''cr
  546. SAY ''||CR
  547. Options Prompt YELLOW'M H B S Q ? ('turnsleft')>'CLEAR
  548. pull ANS
  549. if ans = '###PANIC' then signal goodbye
  550. if ans = 'M' then signal move
  551. if ans = 'H' then signal hire
  552. if ans = 'B' then signal BlackJack
  553. if ans = 'S' then signal Slots
  554. if ans = 'Q' then do
  555.    startx = upper(random(1,25,time('s')))
  556.    starty = upper(random(1,25,time('s')))
  557.    signal goodbye
  558. end
  559. if ans = '' then signal pool
  560. if ans = '?' then do
  561.    SAY ''||CR
  562.    SAY '          'YELLOW'M = Move'||CR
  563.    SAY '          H = Hire new gangmembers'||CR
  564.    SAY '          B = Play a hand of BlackJack'||CR
  565.    SAY '          S = Try the Slot machine'||CR
  566.    SAY '          Q = Quit to 'bbsname ''CLEAR||CR
  567.    SAY ''||CR
  568.    call pressreturn
  569.    /*continue*/
  570. end
  571. signal main
  572.  
  573. BlackJack:
  574.    if money < 1 then do
  575.     say'  You don''t seem to have any cash at this time!'cr
  576.     say'  Sorry, but we don''t play for the fun of it!'
  577.     call casino
  578.     end
  579.    if turnsleft < 1 then do
  580.     say'  Sorry, you don''t have any turns left!'cr
  581.     say'  Try again next time!'cr
  582.     say''cr
  583.     call casino
  584.     end
  585.    turnsleft = turnsleft - 1
  586.    CALL SetClip('CHICMON',money)
  587.    if colorflag = 1 then CALL SetClip('CHICCOLOR','1')
  588.    say ''cr
  589.    say'   OK, let''s play a hand of BlackJack!'
  590.  
  591. /*trace ?r  */
  592.  
  593. curdir=PRAGMA('D')
  594. CALL setdir(bbspath'rexxDoors')
  595.  
  596.    say ''cr
  597.    /*INTERPRET BlackJack.rexx*/
  598.    doors.temp = BlackJack.rexx
  599.    INTERPRET 'call' doors.temp
  600.  
  601.    money = GetClip('CHICMON')
  602.    CALL SetClip('CHICMON','')
  603.    CALL SetClip('CHICCOLOR','')
  604.    say ''cr
  605.    CALL setdir(curdir)
  606.    Call casino
  607.  
  608. Slots:
  609.    if money < 1 then do
  610.     say'  You don''t seem to have any cash at this time!'cr
  611.     say'  Sorry, but we don''t play for the fun of it!'
  612.     call casino
  613.     end
  614.    if turnsleft < 1 then do
  615.     say'  Sorry, you don''t have any turns left!'cr
  616.     say'  Try again next time!'cr
  617.     say''cr
  618.     call casino
  619.     end
  620.    turnsleft = turnsleft - 1
  621.    CALL SetClip('CHICMON',money)
  622.    if colorflag = 1 then CALL SetClip('CHICCOLOR','1')
  623.    say ''cr
  624.    /*say'   OK, let''s play a hand of BlackJack!'*/
  625.  
  626. /*trace ?r  */
  627.  
  628. curdir=PRAGMA('D')
  629. CALL setdir(bbspath'rexxDoors')
  630.  
  631.    say ''cr
  632.    /*INTERPRET BlackJack.rexx*/
  633.    doors.temp = One_Armed_Bandit.rexx
  634.    INTERPRET 'call' doors.temp
  635.  
  636.    money = GetClip('CHICMON')
  637.    CALL SetClip('CHICMON','')
  638.    CALL SetClip('CHICCOLOR','')
  639.    say ''cr
  640.    CALL setdir(curdir)
  641.    Call casino
  642.  
  643.  
  644. setdir:
  645. PARSE ARG tempdir
  646. CALL PRAGMA('D',STRIP(tempdir))
  647. directory=PRAGMA('D')
  648. slash=LASTPOS('/',directory)
  649. IF slash=0 THEN slash=LASTPOS(':',directory)
  650. plaindir=directory
  651. IF slash>0 THEN plaindir=SUBSTR(plaindir,slash+1)
  652. RETURN
  653.  
  654.  
  655. hire:
  656. say CLSCREEN
  657.    if turnsleft < 1 then do
  658.     say'  Sorry, you don''t have any turns left!'cr
  659.     say'  Try again next time!'cr
  660.     say''cr
  661.     signal main
  662.     end
  663. cost = random(100,200,time('s'))
  664. if costfor > cost then cost = costfor
  665. costfor = cost
  666. SAY CYAN'New gangmembers salaries are 'cost' dollars each.'||CR
  667. SAY 'You currently have 'gangmembers 'gangmembers and 'money' dollars.'||CR
  668. SAY ''||CR
  669. possible = money % cost
  670. options prompt MAGENTA'How many gangmembers would you like to hire?('possible' max)'
  671. pull newgang
  672. options prompt ' '
  673. if newgang = 0 | newgang = '' then signal /*pool*/main
  674. do i = 1 to length(newgang)
  675.    if ~datatype(substr(newgang,i,1),N) then do
  676.       SAY RED'You must enter a valid number!'||CR
  677.       CALL delay(100)
  678.       /*signal pool */
  679.       signal main
  680.    end
  681. end
  682. totcost = cost * newgang
  683. if totcost > money then do
  684.    SAY RED'You don''t have enough money for 'newgang' gangmembers!'||CR
  685.    CALL delay(100)
  686.    /*signal pool*/
  687.    signal main
  688. end
  689. SAY MAGENTA'The total of the salaries will be 'totcost' dollars.'||CR
  690. SAY ''||CR
  691. options prompt CYAN'Are you sure you want to hire them? 'CLEAR
  692. pull ans
  693. options prompt ' '
  694. if ans = N then signal /*pool*/main
  695. money = money - totcost
  696. gangmembers = gangmembers + newgang
  697. totalgangmembers = totalgangmembers + newgang
  698. turnsleft = turnsleft - 1
  699. /*signal pool*/
  700. signal main
  701.  
  702. still:
  703.    if turnsleft < 1 then do
  704.     say'  Sorry, you don''t have any turns left!'cr
  705.     say'  Try again next time!'cr
  706.     say''cr
  707.     signal main
  708.     end
  709. if money < 5000 then do
  710.    SAY RED'You do not have enough money!'CLEAR||CR
  711.    CALL delay(100)
  712.    signal pool
  713. end
  714. SAY ''||CR
  715. SAY ''||CR
  716. SAY MAGENTA'Bootleg operations cost $5000 each. You have 'money' dollars.'||CR
  717. options prompt 'How many bootleg operations would you like to purchase?  '
  718. pull ans
  719. do i = 1 to length(ans)
  720.    if ~datatype(substr(ans,i,1),N) then do
  721.       SAY RED'You must enter a valid number!'||CR
  722.       CALL delay(100)
  723.       /*signal pool */
  724.       signal still
  725.    end
  726. end
  727. if ans = '' then signal pool
  728. cost = 5000 * ans
  729. if money < cost then do
  730.    SAY RED'You do not have that much money!'||CR
  731.    signal still
  732. end
  733. options prompt 'It will cost you 'cost' dollars. Are you sure? '
  734. pull ans2
  735.  
  736. if ans2 = 'N' then signal pool
  737. money = money - cost
  738. bootleg = bootleg + ans
  739. SAY ''||CR
  740. SAY CYAN'Nice doing business with you.'CLEAR||CR
  741. turnsleft = turnsleft - 1
  742. CALL delay(100)
  743. signal pool
  744.  
  745. gamble:
  746. say CLSCREEN
  747.    if turnsleft < 1 then do
  748.     say'  Sorry, you don''t have any turns left!'cr
  749.     say'  Try again next time!'cr
  750.     say''cr
  751.     signal pool
  752.     end
  753. options prompt CYAN'You have $'money', how much would you like to bet?($500 limit)'CLEAR
  754. pull bet
  755. options prompt ' '
  756. if bet > 500 then signal gamble
  757. do i = 1 to length(bet)
  758.    if ~datatype(substr(bet,i,1),N) then do
  759.       SAY RED'You must enter a valid whole number!'||CR
  760.       CALL delay(100)
  761.       signal pool
  762.    end
  763. end
  764. SAY ''||CR
  765. if bet > money then do
  766.   SAY RED'You don''t have that much money'CLEAR||CR
  767.   signal pool
  768.   end
  769. win = random(1,3,time('s'))
  770. if bet = '' then signal pool
  771. turnsleft = turnsleft - 1
  772. SAY YELLOW'Rack''em up'||CR
  773. CALL delay(100)
  774. SAY ''||CR
  775. if win = 2 then do
  776.    how = random(1,6,time('s'))
  777.    select
  778.       when how = 1 then SAY MAGENTA'You sank the 8 ball off the break!'||CR
  779.       when how = 2 then SAY MAGENTA'You left him with all 7 balls on the table'||CR
  780.       when how = 3 then SAY MAGENTA'You squeak out a victory by sinking the 8 ball'||CR
  781.       when how = 4 then SAY MAGENTA'He scratches on the 8 ball.'||CR
  782.       when how = 5 then SAY MAGENTA'You leave him with 3 balls on the table. Good work.'||CR
  783.       otherwise SAY MAGENTA'You run the table on him!'||CR
  784.    end
  785.    money = money + bet
  786.    SAY ''||CR
  787.    SAY GREEN'You win!'||CR
  788. end
  789. if win = 1 | win = 3 then do
  790.    how = random(1,6,time('s'))
  791.    select
  792.       when how = 1 then SAY GREEN'He sinks the 8 ball off the break!'||CR
  793.       when how = 2 then SAY GREEN'He left you with all 7 balls on the table'||CR
  794.       when how = 3 then SAY GREEN'He squeaks out a victory by sinking the 8 ball'||CR
  795.       when how = 4 then SAY GREEN'You scratch on the 8 ball. Tough Luck!'||CR
  796.       when how = 5 then SAY GREEN'He leaves you with 3 balls on the table.'||CR
  797.       otherwise SAY GREEN'He runs the table on you!'||CR
  798.    end
  799.    money = money - bet
  800.    SAY ''||CR
  801.    SAY RED'You lose!'||CR
  802. end
  803. CALL delay(100)
  804. signal pool
  805.  
  806. shootout:killflag = 0
  807. shoottotal = 0
  808. say CLSCREEN
  809. do i = 1 to pos
  810.    if posstartx.i = startx & posstarty.i = starty & alias ~= posalias.i then do
  811.       shoottotal = shoottotal + 1
  812.    end
  813. end
  814. if shoottotal = 0 then do
  815.    SAY RED'There is no one to attack!'||CR
  816.    CALL delay(100)
  817.    signal main
  818. end
  819. SAY MAGENTA'Ganglords at your block:'||CR
  820. SAY ''||CR
  821. do i = 1 to pos
  822.    if posstartx.i = startx & posstarty.i = starty & alias ~= posalias.i then do
  823.       SAY BLUE posalias.i  'with' posgang.i 'gangmembers'||CR
  824.       shoottotal = shoottotal + 1
  825.    end
  826. end
  827. SAY ''||CR
  828. w = 0
  829. options prompt MAGENTA'Who do you want to attack?(Return to Quit) '
  830. pull victim
  831. options prompt ' '
  832. if victim = "" then signal main
  833. do i = 1 to pos
  834.    if victim = posalias.i then do
  835.       w = 1
  836.       r = i 
  837.       fight2 = posgang.i
  838.       break
  839.    end
  840.    if w = 1 then break
  841. end
  842. if posalias.r ~= victim then do
  843.    SAY RED'There is no one at this block by that name!'||CR
  844.    CALL delay(100)
  845.    signal main
  846. end
  847. fight3 = fight2
  848. yourper1 = (gangmembers / (gangmembers + fight2)) * 100
  849. if yourper1 > 95 then yourper1 = 95
  850. if yourper1 < 5 then yourper1 = 5
  851. if w = 0 then signal shootout
  852. call open(news7,file.2,'A')
  853. call writeln(news7,'Ganglord 'alias' tries to have a shootout with 'victim'.')
  854. call close(news7)
  855. fight1 = gangmembers
  856. say CLSCREEN
  857. SAY MAGENTA'         Your gang:                      His gang:'CR
  858. SAY BLUE   '        ----------                      ---------'CR
  859.  
  860. shootagain:
  861. say cyan   '             'gangmembers'                                'fight2''CR
  862. SAY ''||CR
  863. if killflag = 0 then do
  864.    options prompt YELLOW'RETURN to Continue  K to Kill  Q to Quit '
  865.    pull ans
  866.    if ans = Q then signal quitter2
  867.    if ans = K then killflag = 1
  868. end
  869. losers1 = Random(1,100)
  870. if yourper1 >= losers1 then fight2 = fight2 - 1
  871. else gangmembers = gangmembers - 1
  872. /*if gangmembers <= -1 then do
  873.    gangmembers = -1
  874.    signal shootyou
  875. end
  876. if fight2 <= -1 then do
  877.    fight2 = -1
  878.    signal shoothim */
  879. if gangmembers <= 0 then do
  880.    gangmembers = 0
  881.    signal shootyou
  882. end
  883. if fight2 <= 0 then do
  884.    fight2 = 0
  885.    signal shoothim
  886. end
  887. /*if colorflag = 1 then do
  888.    SAY HOM||CR
  889.    SAY ''||CR
  890.    SAY ''||CR
  891.    SAY ''||CR
  892.    SAY ''||CR
  893.    SAY '                                                  '||CR
  894.    SAY HOM||CR
  895.    SAY ''||CR
  896.    SAY ''||CR
  897. end      */
  898. signal Shootagain 
  899.               
  900. shootyou:
  901. /*if colorflag = 1 then do
  902.    SAY HOM||CR
  903.    SAY ''||CR
  904.    SAY ''||CR
  905.    SAY ''||CR
  906.    SAY ''||CR
  907.    SAY '                                                  '||CR
  908.    SAY HOM||CR
  909.    SAY ''||CR
  910.    SAY ''||CR
  911. end  */
  912. say cyan   '             'gangmembers'                                'fight2''CR
  913. SAY ''||CR
  914. CALL delay(50)
  915. call open(aliases,bbspath2'gangland/aliases','R')
  916. u = 1
  917. do until EOF(aliases)
  918.   alias1.u = readln(aliases)
  919.    alias2.u = word(alias1.u,1)
  920.    alias3.u = Delword(alias1.u,1,1)
  921.    if alias3.u = victim then do
  922.       aliasfix = alias2.u
  923.       signal shootyou1
  924.    end
  925.    u = u + 1
  926. end
  927.  
  928. shootyou1:
  929. call close(aliases)
  930. call open(provictim,bbspath2'gangland/'aliasfix,'R')
  931. vicalias = readln(provictim)
  932. vicTurnsleft = readln(provictim)
  933. vicgangmembers = readln(provictim)
  934. vicdate = readln(provictim)
  935. vicstartx = readln(provictim)
  936. vicstarty = readln(provictim)
  937. vicpoints = readln(provictim)
  938. vicmoney = readln(provictim)
  939. victotalgangmembers = readln(provictim)
  940. vicprotection = readln(provictim)
  941. vicbootleg = readln(provictim)
  942. call close(provictim)
  943. vicgangmembers = vicgangmembers - (fight3 - fight2)
  944. victotalgangmembers = victotalgangmembers - (fight3 - fight2)
  945. pointsg = victotalgangmembers * 100
  946. pointsp = vicprotection * 1000
  947. vicpoints = pointsg + pointsp
  948. vicmoney = vicmoney + money
  949. vicbootleg = vicbootleg + bootleg
  950. call open(provictim,bbspath2'gangland/'aliasfix,'W')
  951. call writeln(provictim,vicalias)
  952. call writeln(provictim,victurnsleft)
  953. call writeln(provictim,vicgangmembers)
  954. call writeln(provictim,vicdate)
  955. call writeln(provictim,vicstartx)
  956. call writeln(provictim,vicstarty)
  957. call writeln(provictim,vicpoints)
  958. call writeln(provictim,vicmoney)
  959. call writeln(provictim,victotalgangmembers)
  960. call writeln(provictim,vicprotection)
  961. call writeln(provictim,vicbootleg)
  962. call close(provictim)
  963. call open(top10,bbspath2'gangland/top10','R')
  964. do i = 2 to 11
  965.    tops = readln(top10)
  966.    topalias.i = delword(tops,1,1)
  967.    topscore.i = word(tops,1)
  968.    if victim = topalias.i then topscore.i = vicpoints
  969. end
  970. call close(top10)
  971. call open(top10,bbspath2'gangland/top10','W')
  972. do i = 1 to 10
  973.    call writeln(top10,topscore.i' 'topalias.i)
  974. end
  975. call close(top10)
  976. call open(news7,file.2,'A')
  977. call writeln(news7,'Ganglord 'alias' is killed by 'victim'''s gang!')
  978. call close(news7)
  979. signal death
  980.  
  981. shoothim:
  982. /*if colorflag = 1 then do
  983.    SAY HOM||CR
  984.    SAY ''||CR
  985.    SAY ''||CR
  986.    SAY ''||CR
  987.    SAY ''||CR
  988.    SAY '                                                  '||CR
  989.    SAY HOM||CR
  990.    SAY ''||CR
  991.    SAY ''||CR
  992. end   */
  993. say cyan   '             'gangmembers'                                'fight2''CR
  994. SAY ''||CR
  995. SAY center(YELLOW'You wipe him out!',76)||CR
  996. totalgangmembers = totalgangmembers - (Fight1 - gangmembers)
  997. call open(aliases,bbspath2'gangland/aliases','R')
  998. u = 1
  999. do until EOF(aliases)
  1000.    alias1.u = readln(aliases)
  1001.    alias2.u = word(alias1.u,1)
  1002.    alias3.u = Delword(alias1.u,1,1)
  1003.    if alias3.u = victim then break
  1004.    u = u + 1
  1005. end
  1006. call close(aliases)
  1007. call open(provictim,bbspath2'gangland/'alias2.u,'R')
  1008. vicalias = readln(provictim)
  1009. vicTurnsleft = readln(provictim)
  1010. vicgangmembers = readln(provictim)
  1011. vicdate = readln(provictim)
  1012. vicstartx = readln(provictim)
  1013. vicstarty = readln(provictim)
  1014. vicpoints = readln(provictim)
  1015. vicmoney = readln(provictim)
  1016. victotalgangmembers = readln(provictim)
  1017. vicprotection = readln(provictim)
  1018. vicbootleg = readln(provictim)
  1019. call close(provictim)
  1020. money = vicmoney + money
  1021. bootleg = vicbootleg + bootleg
  1022. do i = 1 to pos
  1023.    if victim = posalias.i then do
  1024.       money = money + posmoney.i
  1025.       mypos.i = ''
  1026.       posstartx.i = ''
  1027.       posstarty.i = ''
  1028.       posgang.i = ''
  1029.       posmoney.i = ''
  1030.       posalias.i = ''
  1031.    end
  1032. end
  1033. call open(aliases,bbspath2'gangland/aliases','R')
  1034. do o = 1 to 10000
  1035.    alias1.o = readln(aliases)
  1036.    alias2.o = Word(alias1.o,1)
  1037.    alias3.o = Delword(alias1.o,1,1)
  1038.    if victim = alias3.o then do
  1039.       /*delete(bbspath2'gangland/'alias2.o)*/
  1040.       address command 'c:delete 'bbspath2'gangland/'alias2.o' quiet'
  1041.       alias1.o = ''
  1042.    end
  1043.    if EOF(aliases) then break
  1044. end
  1045. j = o
  1046. call close(aliases)
  1047. call open(aliases,bbspath2'gangland/aliases','W')
  1048. do o = 1 to 10000
  1049.    if alias1.o ~= '' then call writeln(aliases,alias1.o)
  1050.    if o = j then break 
  1051. end
  1052. call close(aliases)
  1053. do c = 1 to 25
  1054.    do c1 = 1 to 25
  1055.       if Delword(protect.c.c1,1,1) = victim then
  1056.       protect.c.c1 = 0
  1057.     end
  1058. end
  1059. SAY ''||CR
  1060. call open(top10,bbspath2'gangland/top10','R')
  1061. do i = 1 to 10
  1062.    tops.i = readln(top10)
  1063.    if delword(tops.i,1,1) = victim then tops.i = '0 'victim
  1064. end
  1065. call close(top10)
  1066. call open(top10,bbspath2'gangland/top10','W')
  1067. do i = 1 to 10
  1068.    call writeln(top10,tops.i)
  1069. end
  1070. call close(top10)
  1071. call open(news7,file.2,'A')
  1072. call writeln(news7,'Ganglord 'alias' slaughters 'victim)
  1073. call close(news7)
  1074. signal main
  1075.  
  1076. quitter2:
  1077. do i = 1 to pos
  1078.    if victim = posalias.i then do
  1079.       w = 1 
  1080.       posgang.i = fight2
  1081.       break
  1082.    end
  1083. end
  1084. call open(news7,file.2,'A')
  1085. call writeln(news7,'Ganglord 'alias' runs from the shootout.')
  1086. call close(news7)
  1087. SAY center(YELLOW'Chicken!',76)||CR
  1088. CALL delay(100)
  1089. signal main
  1090.  
  1091. protection:
  1092. if gangmembers < 1 then do
  1093.    SAY ''||CR
  1094.    SAY RED'You don''t have enough gangmembers with you to offer protection!'CLEAR||CR
  1095.    CALL delay(100)
  1096.    signal main
  1097. end
  1098. protectors = word(protect.startx.starty,1)
  1099. if protectors = 0 then signal noprotect
  1100. do
  1101.    protect_alias = Delword(protect.startx.starty,1,1)
  1102.    SAY ''||CR
  1103.    SAY ''||CR
  1104.    SAY RED'The block already has protection from 'protect_alias'!'CLEAR||CR
  1105.    CALL delay(100)
  1106.    signal main 
  1107. end
  1108.  
  1109. noprotect:
  1110. SAY ''||CR
  1111. options prompt GREEN'How many gangmembers do you want to leave here?'CLEAR
  1112. pull protectors
  1113. options prompt ' '
  1114. if protectors = 0 then signal main
  1115. if protectors = ' ' then signal main
  1116. do i = 1 to length(protectors)
  1117.    if ~datatype(substr(protectors,i,1),N) then do
  1118.       SAY RED'You must enter a valid whole number!'||CR
  1119.       CALL delay(100)
  1120.       signal main
  1121.    end
  1122. end
  1123. if gangmembers - protectors < 0 then do
  1124.    SAY RED'You don''t have that many gangmembers!'||CR
  1125.    signal noprotect
  1126. end
  1127. gangmembers = gangmembers - protectors
  1128. protection = protection + 1
  1129. protect.startx.starty = protectors' 'alias
  1130. turnsleft = turnsleft - 1
  1131. signal main
  1132.  
  1133. addon:
  1134. say CLSCREEN
  1135. protect_gang = word(protect.startx.starty,1)
  1136. if protect_alias ~= alias then do
  1137.    SAY RED'You have to move to a block you are protecting to add gangmembers'CLEAR||CR
  1138.    CALL delay(100)
  1139.    signal main
  1140. end
  1141. SAY GREEN'You currently have 'protect_gang' gangmembers protecting this block.'||CR
  1142. options prompt GREEN'How many gangmembers do you want to add?'
  1143. pull addto
  1144. options prompt ' '
  1145. if addto = '' then signal main
  1146. if gangmembers - addto < 0 then do
  1147.    SAY RED'You don''t have that many gangmembers!'||CR
  1148.    CALL delay(100)
  1149.    signal main
  1150. end
  1151. if protect_gang + addto < 1 then do
  1152.    SAY RED'You can''t have less than 1 gangmember!'||CR
  1153.    CALL delay(100)
  1154.    signal main
  1155. end
  1156. protect_add = addto + protect_gang
  1157. protect.startx.starty = protect_add ' ' alias
  1158. gangmembers = gangmembers - addto
  1159. signal main
  1160.  
  1161. hitother:
  1162. killflag = 0
  1163. say CLSCREEN
  1164. if proflag = 1 then do
  1165.    SAY RED'There is no one protecting this block!'CLEAR||CR
  1166.    CALL delay(100)
  1167.    signal main
  1168. end
  1169. if alias = protect_alias then do
  1170.    SAY RED'You cannot attack yourself!'||CR
  1171.    CALL delay(100)
  1172.    signal main
  1173. end
  1174. lostgang = protect_gang
  1175. yourper = (gangmembers / (gangmembers + lostgang)) * 100
  1176. if yourper > 95 then yourper = 95
  1177. call open(news7,file.2,'A')
  1178. call writeln(news7,'Ganglord 'alias' tries to hit 'protect_alias'''s block.')
  1179. call close(news7)
  1180. SAY MAGENTA'           Your gang:                      His gang:'CR
  1181. SAY BLUE   '          ----------                      ---------'CR
  1182.  
  1183. hitagain:
  1184. say cyan   '               'gangmembers'                              'protect_gang''CR
  1185. SAY ''||CR
  1186. if killflag = 0 then do
  1187.    options prompt YELLOW'RETURN to Continue  K to kill  Q to Quit '
  1188.    pull ANS
  1189.    if ans = Q then signal quitter
  1190.    if ans = K then killflag = 1
  1191. end
  1192. losers = random(1,100)
  1193. if yourper >= losers then Protect_gang = Protect_gang - 1
  1194. else gangmembers = gangmembers - 1
  1195. if gangmembers <= -1 then do
  1196.    gangmembers = -1
  1197.    signal hityou
  1198. end
  1199. if protect_gang <= 0 then do
  1200.    protect_gang = 0
  1201.    signal hitthem
  1202. end
  1203. /*if colorflag = 1 then do
  1204.    SAY HOM||CR
  1205.    SAY ''||CR
  1206.    SAY ''||CR
  1207.    SAY ''||CR
  1208.    SAY ''||CR
  1209.    SAY '                                                  '||CR
  1210.    SAY HOM||CR
  1211.    SAY ''||CR
  1212.    SAY ''||CR
  1213. end  */
  1214. signal hitagain   
  1215.  
  1216. Hityou:
  1217. /*if colorflag = 1 then do
  1218.    SAY HOM||CR
  1219.    SAY ''||CR
  1220.    SAY ''||CR
  1221.    SAY ''||CR
  1222.    SAY ''||CR
  1223.    SAY '                                                  '||CR
  1224.    SAY HOM||CR
  1225.    SAY ''||CR
  1226.    SAY ''||CR
  1227. end  */
  1228. say cyan   '               'gangmembers'                              'protect_gang''CR
  1229. SAY ''||CR
  1230. protect.startx.starty = protect_gang' 'protect_alias
  1231. CALL delay(100)
  1232. call open(news7,file.2,'A')
  1233. call writeln(news7,'Ganglord 'alias' is killed by 'protect_gang'''s gang!')
  1234. call close(news7)
  1235. signal death
  1236.  
  1237. hitthem:
  1238. /*if colorflag = 1 then do
  1239.    SAY HOM||CR
  1240.    SAY ''||CR
  1241.    SAY ''||CR
  1242.    SAY ''||CR
  1243.    SAY ''||CR
  1244.    SAY '                                                  '||CR
  1245.    SAY HOM||CR
  1246.    SAY ''||CR
  1247.    SAY ''||CR
  1248. end    */
  1249. say cyan   '               'gangmembers'                              'protect_gang''CR
  1250. SAY ''||CR
  1251. protect.startx.starty = 0
  1252. SAY ''||CR
  1253. SAY center(YELLOW'You wipe him out!',76)||CR
  1254. CALL delay(100)
  1255. call open(news7,file.2,'A')
  1256. call writeln(news7,'Ganglord 'alias' slaughters 'protect_alias'''s gang!')
  1257. call close(news7)
  1258. call open(aliases,bbspath2'gangland/aliases','R')
  1259. u = 0
  1260. do until EOF(aliases)
  1261.    u = u + 1
  1262.    alias1.u = readln(aliases)
  1263.    alias2.u = word(alias1.u,1)
  1264.    alias3.u = Delword(alias1.u,1,1)
  1265.    if alias3.u = protect_alias then do
  1266.       alias2 = alias2.u
  1267.       alias3 = alias3.u
  1268.       break
  1269.    end 
  1270. end
  1271. call close(aliases)
  1272. call open(provictim,bbspath2'gangland/'alias2,'R')
  1273. vicalias = readln(provictim)
  1274. vicTurnsleft = readln(provictim)
  1275. vicgangmembers = readln(provictim)
  1276. vicdate = readln(provictim)
  1277. vicstartx = readln(provictim)
  1278. vicstarty = readln(provictim)
  1279. vicpoints = readln(provictim)
  1280. vicmoney = readln(provictim)
  1281. victotalgangmembers = readln(provictim)
  1282. vicprotection = readln(provictim)
  1283. vicbootleg = readln(provictim)
  1284. call close(provictim)
  1285. vicprotection = vicprotection - 1
  1286. victotalgangmembers = victotalgangmembers - lostgang
  1287. call open(provictim,bbspath2'gangland/'alias2,'W')
  1288. call writeln(provictim,vicalias)
  1289. call writeln(provictim,victurnsleft)
  1290. call writeln(provictim,vicgangmembers)
  1291. call writeln(provictim,vicdate)
  1292. call writeln(provictim,vicstartx)
  1293. call writeln(provictim,vicstarty)
  1294. call writeln(provictim,vicpoints)
  1295. call writeln(provictim,vicmoney)
  1296. call writeln(provictim,victotalgangmembers)
  1297. call writeln(provictim,vicprotection)
  1298. call writeln(provictim,vicbootleg)
  1299. call close(provictim)
  1300. call open(top10,bbspath2'gangland/top10','R')
  1301. do i = 1 to 10
  1302.    tops = readln(top10)
  1303.    topalias.i = delword(tops,1,1)
  1304.    topscore.i = word(tops,1)
  1305.    if protect_alias = topalias.i then topscore.i = (topscore.i - 1000 - (lostgang * 100))
  1306. end
  1307. call close(top10)
  1308. call open(top10,bbspath2'gangland/top10','W')
  1309. do i = 1 to 10
  1310.    call writeln(top10,topscore.i' 'topalias.i)
  1311. end
  1312. call close(top10)
  1313. signal main
  1314.  
  1315. quitter:
  1316. protect.startx.starty = protect_gang' 'protect_alias
  1317. call open(news7,file.2,'A')
  1318. call writeln(news7,'Ganglord 'alias' runs from the fight.')
  1319. call close(news7)
  1320. SAY center(YELLOW'Chicken!',76)||CR
  1321. CALL delay(100)
  1322. signal main
  1323.  
  1324. move:
  1325. if turnsleft < 1 then do
  1326.    SAY ''||CR
  1327.    SAY RED'You do not have any turns left!'||CR
  1328.    CALL delay (100)
  1329.    signal main
  1330. end
  1331. SAY ''||CR
  1332. SAY ''||CR
  1333. SAY BLUE'What location do you want to move to?'||CR
  1334. options prompt '                               North:'
  1335. pull startxtemp1
  1336. options prompt ' '
  1337. startxtemp = strip(startxtemp1,'L','0')
  1338. do i = 1 to 25
  1339.    if startxtemp = i then leave
  1340.    if i = 25 then do
  1341.       SAY ''||CR
  1342.       SAY RED'Street numbers can only be whole numbers between 1 and 25'CLEAR||CR
  1343.       CALL delay(100)
  1344.       signal main
  1345.    end
  1346. end
  1347. options prompt '                                East:'
  1348. pull startytemp1
  1349. options prompt ' '
  1350. startytemp = strip(startytemp1,'L','0')
  1351. do i = 1 to 25
  1352.    if startytemp = i then leave
  1353.    if i = 25 then do
  1354.       SAY ''||CR
  1355.       SAY RED'Street numbers can only be whole numbers between 1 and 25'CLEAR||CR
  1356.       CALL delay(100)
  1357.       signal main
  1358.    end
  1359. end
  1360. startx = startxtemp
  1361. starty = startytemp
  1362. turnsleft = turnsleft - 1
  1363. signal main
  1364.  
  1365. highscores:
  1366. call open(top10,bbspath2'gangland/top10','R')
  1367. pointsg = totalgangmembers * 100
  1368. pointsp = protection * 1000
  1369. points = pointsg + pointsp
  1370. topalias.1 = alias
  1371. topscore.1 = points
  1372. do i = 2 to 11
  1373.    tops = readln(top10)
  1374.    topalias.i = delword(tops,1,1)
  1375.    topscore.i = word(tops,1)
  1376.    if topalias.1 = topalias.i then topscore.i = -1
  1377. end
  1378. call close(top10)
  1379. do i = 1 to 10
  1380.    do h = i + 1 to 11
  1381.       if topscore.i < topscore.h then do
  1382.          temp = topscore.i
  1383.          topscore.i = topscore.h
  1384.          topscore.h = temp
  1385.          tempor = topalias.i
  1386.          topalias.i = topalias.h
  1387.          topalias.h = tempor
  1388.       end
  1389.    end
  1390. end
  1391. say CLSCREEN
  1392.  
  1393. /*----------------------------------------------------------------------
  1394.                          Check for a winner!
  1395. -----------------------------------------------------------------------*/
  1396. wingoal = 500000
  1397.  do i = 1 to 10
  1398.   if datatype(topscore.i,'N') = 1 & topscore.i >= wingoal then do
  1399.    winner = topalias.i
  1400.    winscore = topscore.i
  1401.     if ~exists(file.12) then do
  1402.      call open(winfile,file.12,'W')
  1403.      writeln(winfile,date'    'winner'    'winscore)
  1404.      call close(winfile)
  1405.      temp.file = 'Ram:temp.file12'
  1406.      address command 'c:copy 'file.12' 'temp.file' quiet'
  1407.      end
  1408.     else do
  1409.      call open(winfile,file.12,'A')
  1410.      writeln(winfile,date'    'winner'    'winscore)
  1411.      call close(winfile)
  1412.      temp.file = 'Ram:temp.file12'
  1413.      address command 'c:copy 'file.12' 'temp.file' quiet'
  1414.      end
  1415.   say ''cr
  1416.   say' 'YELLOW'                 We have a winner!!!'cr
  1417.   say' 'RED' 'winner' is being added to ''The GangLord Hall of Fame!'''Clear''cr
  1418.   say ''cr
  1419.   signal reset
  1420.   end
  1421.  end
  1422.  
  1423. SAY YELLOW||center('-----------------------------------------',70)||CR
  1424. SAY RED||center('Top 10 Chicago Ganglords',70)||CR
  1425. SAY YELLOW||center('-----------------------------------------',70)||CR
  1426. SAY ''||CR
  1427. call open(top10,bbspath2'gangland/top10','W')
  1428. do i = 1 to 10
  1429.    say cyan||CENTER(LEFT(topalias.i,20) RIGHT(topscore.i,7),70)||CR
  1430.    call writeln(top10,topscore.i' 'topalias.i)
  1431. end
  1432. call close(top10)
  1433. SAY ''||CR
  1434. if quiting = 1 then do
  1435.  SAY ''||CR
  1436.  SAY ''||CR
  1437.  SAY '              'RED' Thank you for playing Chicago Gangland'||CR
  1438.  SAY ''||CR
  1439.  SAY '            'MAGENTA'Now returning you to the 'bbsname' 'CLEAR||CR
  1440.  SAY ''||CR
  1441.  CALL delay(100)
  1442. exit
  1443. end
  1444. call pressreturn
  1445. /*continue*/
  1446. signal main
  1447.  
  1448. news:
  1449. say CLSCREEN
  1450. q = 0
  1451. do i = 2 to 8
  1452.    select
  1453.       when i = 2 then SAY CYAN||CR
  1454.       when i = 3 then SAY RED||CR
  1455.       when i = 4 then SAY MAGENTA||CR
  1456.       when i = 5 then SAY BLUE||CR
  1457.       when i = 6 then SAY GREEN||CR
  1458.       when i = 7 then SAY YELLOW||CR
  1459.       otherwise SAY WHITE||CR
  1460.    end
  1461.    if exists(file.i) then call open(gamenews,file.i,'R')
  1462.    if exists(file.i) then do until EOF(gamenews)
  1463.       q = q + 1
  1464.       SAY Readln(gamenews)||CR
  1465.       if q // (LINES - 3) = 0 then do
  1466.          options prompt 'Hit RETURN to continue or Q to quit '
  1467.          pull ANS
  1468.          if ans = 'Q' then do
  1469.             call close(gamenews)
  1470.             signal main
  1471.          end
  1472.       end
  1473.    end
  1474.    call close(gamenews)
  1475. end
  1476. /*call pressreturn*/
  1477. /*continue*/
  1478. if i = 8 /*& eof(file.1) = 1 then do*/then signal main
  1479.  call pressreturn
  1480.  signal main
  1481.  end
  1482.  
  1483. instructions:
  1484. say CLSCREEN
  1485. SAY ''||CR
  1486. i = 1
  1487. call open(instr,file.1,'R')
  1488. do until EOF(instr)
  1489.    SAY Readln(instr)||CR
  1490.    if i // LINES = 0 
  1491.    then do
  1492.       call pressreturn
  1493.       /*continue*/
  1494.    end
  1495.    i = i + 1
  1496. end
  1497. call close(instr)
  1498. call pressreturn
  1499. /*continue*/
  1500. signal main
  1501.  
  1502. stats:
  1503. say CLSCREEN
  1504. SAY center(RED'-----------------------------------------',76)||CR
  1505. SAY center(YELLOW||Spacename'''s' 'STATISTICS',76)||CR
  1506. SAY center(RED'-----------------------------------------',76)||CR
  1507. SAY ''||CR
  1508. Say CYAN '   Alias: 'Alias''cr
  1509. Say CYAN '   Position: ' Street.startx 'North ' Street.starty 'East'CR
  1510. Say CYAN '   Total Gangmembers: 'totalgangmembers''CR
  1511. Say CYAN '   Gangmembers with you: 'gangmembers''CR
  1512. Say CYAN '   Money: 'money''CR
  1513. Say CYAN '   Bootleg Operations: 'bootleg''CR
  1514. SAY ''||CR
  1515. SAY CYAN 'Blocks protected:'||CR
  1516. i = 12
  1517. do c = 1 to 25
  1518.    do c1 = 1 to 25
  1519.       protect_alias = Delword(protect.c.c1,1,1)
  1520.       if protect_alias = alias then do
  1521.          SAY MAGENTA street.c 'North' street.c1 'East with' word(protect.c.c1,1) 'gangmembers'||CR
  1522.          if i // LINES - 1 = 0 then call pressreturn
  1523.          i = i + 1
  1524.       end
  1525.    end
  1526. end
  1527. call pressreturn
  1528. /*continue*/
  1529. signal main
  1530.  
  1531. reset:
  1532.  say ''cr
  1533.  say ' Please standby, the game is being reset!'cr
  1534.  say ''cr
  1535.  address command 'c:delete 'bbspath2'Gangland/#? quiet'
  1536.  backuppath = bbspath2'GangBackups/'
  1537.  
  1538.  address command 'c:copy 'backuppath'news6 'file.3' quiet'
  1539.  address command 'c:copy 'backuppath'news5 'file.4' quiet'
  1540.  address command 'c:copy 'backuppath'news4 'file.5' quiet'
  1541.  address command 'c:copy 'backuppath'news3 'file.6' quiet'
  1542.  address command 'c:copy 'backuppath'news2 'file.7' quiet'
  1543.  address command 'c:copy 'backuppath'news1 'file.8' quiet'
  1544.  address command 'c:copy 'backuppath'aliases 'file.13' quiet'
  1545.  address command 'c:copy 'backuppath'protect 'file.9' quiet'
  1546.  address command 'c:copy 'backuppath'top10 'file.14' quiet'
  1547.  address command 'c:copy 'temp.file' 'file.12' quiet'
  1548.  call delete(temp.file)
  1549.     call open(news7,file.2,'W')
  1550.     call writeln(news7,'******************************************************')
  1551.     call writeln(news7,'                THE CHICAGO DAILY NEWS')
  1552.     call writeln(news7,'                     'datec)
  1553.     call writeln(news7,'******************************************************')
  1554.     call writeln(news7,' ')
  1555.     call writeln(news7,' GangLord 'winner' wins the game with a score of 'winscore'!')
  1556.     call writeln(news7,' The game has been reset!')
  1557.     call close(news7)
  1558.  
  1559.  mess = ''winner' has won the game, and the game has been reset!'
  1560.  call open(fnx,file.11,'W');call writeln(fnx,mess);call close(fnx)
  1561.  
  1562.  say ''cr
  1563.  say' The game is now reset!'cr
  1564.  say' Play again to be the first gangster in the new game!'cr
  1565.  say ''cr
  1566.  exit
  1567.  
  1568.  
  1569. death:
  1570. say CLSCREEN
  1571. SAY center(RED'You have died 'SpaceName'.',76)||CR
  1572. SAY ''||CR
  1573. Say CYAN'Clearing your stats..'CR
  1574. do c = 1 to 25
  1575.    CALL WRITECH(STDOUT,'.')
  1576.    do c1 = 1 to 25
  1577.       protect_alias = Delword(protect.c.c1,1,1)
  1578.       if protect_alias = alias then
  1579.       protect.c.c1 = 0  
  1580.    end
  1581. end
  1582. /*delete(bbspath2'gangland/'Name)     */
  1583. address command 'c:delete 'bbspath2'gangland/'Name' quiet'
  1584. totalgangmembers = 0
  1585. protection = 0
  1586. deathflag = 1
  1587. signal goodbye
  1588.  
  1589. goodbye:
  1590. say CLSCREEN
  1591. Say CYAN'Saving game stats..'cr
  1592. call open(aliases,bbspath2'gangland/aliases','W')
  1593. u = 1
  1594. do i = 1 to marker - 1
  1595.    if name' 'alias ~= alias1.u then
  1596.    call writeln(aliases,alias1.u)
  1597.    u = u + 1
  1598. end
  1599. if deathflag = 0 then call writeln(aliases,name' 'alias)
  1600. call close(aliases)
  1601. call open(lastpos,file.10,'W')
  1602. q = 1
  1603. if pos ~= 0 then do i = 1 to pos
  1604.    if alias ~= posalias.q then
  1605.    call writeln(lastpos,mypos.q)
  1606.    q = q + 1
  1607. end
  1608. if deathflag = 0 then call writeln(lastpos,startx' 'starty' 'gangmembers' 'money' 'alias)
  1609. call close(lastpos)
  1610. call open(prot,File.9,'W')
  1611. do c = 1 to 25
  1612.    CALL WRITECH(STDOUT,'.')
  1613.    do c1 = 1 to 25
  1614.       call writeln(prot,protect.c.c1)
  1615.    end
  1616. end
  1617. call writeln(prot,datec)
  1618. call close(prot)
  1619. pointsg = totalgangmembers * 100
  1620. pointsp = protection * 1000
  1621. points = pointsg + pointsp
  1622. call open(top10,bbspath2'gangland/top10','R')
  1623. topalias.1 = alias
  1624. topscore.1 = points
  1625. do i = 2 to 11
  1626.    tops = readln(top10)
  1627.    topalias.i = delword(tops,1,1)
  1628.    topscore.i = word(tops,1)
  1629.    if topalias.1 = topalias.i then topscore.i = -1
  1630. end
  1631. call close(top10)
  1632. do i = 1 to 10
  1633.    do h = i + 1 to 11
  1634.       if topscore.i < topscore.h then do
  1635.          temp = topscore.i
  1636.          topscore.i = topscore.h
  1637.          topscore.h = temp
  1638.          tempor = topalias.i
  1639.          topalias.i = topalias.h
  1640.          topalias.h = tempor
  1641.       end
  1642.    end
  1643. end
  1644. call open(top10,bbspath2'gangland/top10','W')
  1645. do i = 1 to 10
  1646.    call writeln(top10,topscore.i' 'topalias.i)
  1647. end
  1648. call close(top10)
  1649. if exists(bbspath2'gangland/'Name) then do
  1650.    call open(stats,bbspath2'gangland/'Name,'W')
  1651.    call writeln(stats,alias)
  1652.    call writeln(stats,turnsleft)
  1653.    call writeln(stats,gangmembers)
  1654.    call writeln(stats,datec)
  1655.    call writeln(stats,startx)
  1656.    call writeln(stats,starty)
  1657.    call writeln(stats,points)
  1658.    call writeln(stats,money)
  1659.    call writeln(stats,totalgangmembers)
  1660.    call writeln(stats,protection)
  1661.    call writeln(stats,bootleg)
  1662.    call close(stats)
  1663. end
  1664. say CLSCREEN
  1665. call oneliner
  1666. quiting = 1
  1667. call highscores
  1668. SAY ''||CR
  1669. SAY ''||CR
  1670. SAY '              'RED' Thank you for playing Chicago Gangland'||CR
  1671. SAY ''||CR
  1672. SAY '            'MAGENTA'Now returning you to the 'bbsname' 'CLEAR||CR
  1673. CALL delay(100)
  1674. exit
  1675.  
  1676. ONELINER:
  1677. say ''cr
  1678. options prompt ''CYAN' Do you want to leave a message for the next Gangster (y/N)?'CLEAR' > '
  1679.  
  1680. pull result;ans=upper(result)
  1681. if ans~='Y' then do
  1682.   say ''YELLOW'  No'CLEAR''cr
  1683.   return
  1684.   end
  1685. say ''WHITE'  Yes'CLEAR''cr;say ''cr
  1686. options prompt''GREEN' Enter a ONE LINE message:'CLEAR' ';say ''cr
  1687.  
  1688. pull result; mess=result
  1689. if length(mess)<10 then do
  1690.   say ''YELLOW'Message too short, Entry Aborted.'CLEAR''cr;signal ONELINER
  1691.   end
  1692. say ''cr
  1693. say ''longdashes''cr
  1694. say ''MAGENTA''mess ''alias''CLEAR''cr
  1695. say ''longdashes''cr
  1696. say ''cr
  1697. options prompt ''BLUE' Does this look OK?'CLEAR' > '
  1698.  
  1699.  
  1700. pull result;ans=upper(result)
  1701. if ans='N' then do
  1702.   say ' Nope!'cr;signal ONELINER
  1703.   end
  1704. say ''MAGENTA' Yep!'CLEAR''cr
  1705. if exists(file.11) then do
  1706.   address command 'c:delete 'file.11' quiet'
  1707.   end
  1708. call open(fnx,file.11,'W');call writeln(fnx,mess);call writeln(fnx,alias);call close(fnx)
  1709. return
  1710.  
  1711.  
  1712. quickexit:
  1713.    say CLSCREEN
  1714.    call oneliner
  1715.    quiting = 1
  1716.    call highscores
  1717.    SAY ''||CR
  1718.    SAY ''||CR
  1719.    SAY '              'RED' Thank you for playing Chicago Gangland'||CR
  1720.    SAY ''||CR
  1721.    SAY '            'MAGENTA'Now returning you to 'bbsname' 'CLEAR||CR
  1722.    CALL delay(100)
  1723.    exit
  1724.  
  1725. pressreturn:
  1726. say ''cr
  1727. options prompt'  Press return to continue'
  1728. pull response
  1729. return
  1730.  
  1731. /************************* Error Checking *********************************/
  1732.  
  1733. syntax:
  1734.    SAY '*BOOM*  Got a syntax error.  PLEASE notify the sysop.'||CR
  1735.    SAY 'Line:' SIGL '   Error Code:' RC||CR
  1736.    call CloseShop
  1737. exit
  1738.  
  1739. ioerr:
  1740.    SAY '*BOOM*  Got an IO error.  PLEASE notify the sysop.'||CR
  1741.    SAY 'Line:' SIGL||CR
  1742.    call CloseShop
  1743. exit
  1744.  
  1745. exit
  1746. end
  1747.  
  1748. CloseShop: procedure
  1749.    if NoCarrier() then call DieGracefully
  1750.    Options prompt 'Press RETURN:'
  1751.    exit
  1752. return
  1753.  
  1754. DieGracefully: procedure
  1755.    'exit'
  1756.    exit
  1757. return
  1758.  
  1759. NoCarrier:
  1760. IF ADDRESS()~='BAUD' THEN RETURN 0
  1761. dcd
  1762. IF RC=0 THEN RETURN 1
  1763. RETURN 0
  1764.  
  1765.  
  1766. BREAK_C:
  1767. BREAK_E:
  1768. call goodbye
  1769. CALL CLOSE(f)
  1770. RETURN(count);
  1771. EXIT;                           /* a little redundant, so sue me! */
  1772.  
  1773. /**************************************************************************/